from sympy import symbols, diff, sin, cos

a, t = symbols('a t')

# 摆线参数方程
x_cycloid = a * (t - sin(t))
y_cycloid = a * (1 - cos(t))

# 求导计算
dx_dt_cycloid = diff(x_cycloid, t)
dy_dt_cycloid = diff(y_cycloid, t)
dy_dx_cycloid = dy_dt_cycloid / dx_dt_cycloid

# 二阶导数
d2y_dx2_cycloid = diff(dy_dx_cycloid, t) / dx_dt_cycloid

print("摆线方程的高阶导数:")
print(f"x = {x_cycloid}")
print(f"y = {y_cycloid}")
print(f"一阶导数: {dy_dx_cycloid.simplify()}")
print(f"二阶导数: {d2y_dx2_cycloid.simplify()}")